package com.contacts.biz.impl;

import java.sql.SQLException;
import java.util.List;

import com.contacts.biz.UserBiz;
import com.contacts.dao.impl.UserDaoImpl;
import com.contacts.model.Contact;
import com.contacts.model.TelBook;
import com.contacts.model.User;

public class UserBizImpl implements UserBiz {
	private UserDaoImpl impl = new UserDaoImpl();
    @Override
	public User login(String uname, String upwd) {
		
		return impl.findByNameAndPwd(uname,upwd);
	}
    @Override
	public List<TelBook> showTelBook(int uid) {
		
		return impl.showTelBook(uid);
	}
    @Override
	public List<Contact> showContact(int uid, int tid) {
    	
		return impl.queryContact(uid,tid);
	}
    @Override
	public boolean addContact(String cname, String ctel, int uid, int tid) throws SQLException {
		
		return impl.addContact(cname,ctel,uid,tid);
	}
    @Override
	public boolean deleteContact(int cid) throws SQLException {
		
		return impl.deleteContact(cid);
	}
    @Override
	public boolean changeContact(String newName, String newTel, int cid) throws SQLException {
		
		return impl.changeContact(newName,newTel,cid);
	}
    @Override
	public Contact serchContact(String cname,int uid) {
		
		return impl.serchContact(cname,uid);
	}
}
